FEAT Consolidating scenario techniques#1785
Merged
rlundeen2 merged 12 commits intoMay 29, 2026
Merged
Conversation
275586f to
c029636
Compare
…05_22_scenario_technique_consolidation # Conflicts: # pyrit/registry/object_registries/attack_technique_registry.py
Callers now pass adversarial_config directly (wrapping a bare PromptTarget in AttackAdversarialConfig as needed). No registration site was using the convenience kwarg, so removing it simplifies the factory API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace terse 'Forwarded to __init__' arg docs with descriptions matching the __init__ prose. Hoist PromptSendingAttack, AttackAdversarialConfig, AttackScoringConfig, and get_default_adversarial_target to module-level imports — pyrit.executor does not import from pyrit.scenario, so there is no circular-import risk. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…05_22_scenario_technique_consolidation
…ending PromptSendingAttack is intentionally not registered as a scenario technique factory; BaselineAttackPolicy.Enabled prepends it as an atomic attack instead. Update stale test expectations and drop the empty single_turn aggregate from CyberStrategy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop _adversarial_config_was_explicit flag; use a local variable in create() for the lazily resolved default. Factory stays stateless across create() calls and the explicit/lazy distinction is now expressible via self._adversarial_config alone. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds AttackTechniqueRegistry.get_factories_or_raise() so scenario strategy builders and Scenario.initialize_async share one descriptive error when the registry hasn't been populated, instead of silently producing empty strategy enums or empty attack lists. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…05_22_scenario_technique_consolidation Resolves conflict in deleted pyrit/scenario/core/scenario_techniques.py by keeping the deletion (this PR's purpose) and porting main's new PAIRAttack technique into the consolidated pyrit/setup/initializers/components/scenario_techniques.py. Updated the merged-in test to use the new build_scenario_technique_factories() API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
hannahwestra25
approved these changes
May 29, 2026
Contributor
hannahwestra25
left a comment
There was a problem hiding this comment.
looks good! i like the simplification !
ValbuenaVC
pushed a commit
to ValbuenaVC/PyRIT
that referenced
this pull request
May 29, 2026
…pt factory registry API - Replace SCENARIO_TECHNIQUES/AttackTechniqueSpec with AttackTechniqueFactory registry - Add @cache to _build_benchmark_strategy; drop deleted classmethods - Adopt default_strategy=/default_dataset_config= in super().__init__ (microsoft#1784 contract) - Loop: factory.create(attack_adversarial_config_override=AttackAdversarialConfig(target=...)) - Rename skip_cached -> use_cached throughout - Test fixture: use build_scenario_technique_factories() + mock adversarial_chat target (matches PR microsoft#1785 pattern); module-level constants from production catalog Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the separate
AttackTechniqueSpecdataclass and scenario_techniques.py registration shim with a single self-describingAttackTechniqueFactorythat owns both the technique configuration and the deferred attack construction. The only reasonAttackTechniqueSpecexisted was for how the CLI worked pre-REST api.Now we can also move scenario registration centrally to initializers, which this PR also does.